﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Arch.Client.Infrastructure;
using Arch.Samples.RiaServices.Services;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using Arch.Client.Commands;
using System.ServiceModel.DomainServices.Client;
using System.Diagnostics;
using Microsoft.Practices.Unity;
using Arch.Samples.RiaServices.Commands;

namespace Arch.Samples.RiaServices.Infrastructure
{
    public class ContextViewModelBase :  ViewModelBase
    {
        public ContextViewModelBase(TodoContext context)
        {
            Context = context;

            CancelCommand = new CancelCommand<ContextViewModelBase>(this);
        }

        public ICommand SubmitCommand { get; protected set; }
        public ICommand CancelCommand { get; protected set; }

        public TodoContext Context { get; protected set; }

        private DomainDataSource _DataSource;
        public DomainDataSource DataSource
        {
            get { return _DataSource; }
            set
            {
                if (_DataSource != value)
                {
                    _DataSource = value;
                    RaisePropertyChanged("DataSource");
                }
            }
        }
        
        public virtual void Refresh()
        {

        }
    }
}
